package com.ytf.test.tenth;

/**
 * @author: YTF
 * @date: 2025/3/29
 * @version: 1.0
 * @description:
 */
class D{
    void strD(){
        System.out.println("D strD");
    }
}
abstract class E{
    abstract void strE();
}
class Z extends D{
    E makeE(){
        return new E() {
            @Override
            void strE() {
                System.out.println("Z strE");
            }
        };
    }
}
public class MultiImplementation {
    static void takesD(D d) {
        d.strD();
    }
    static void takesE(E e) {
        e.strE();
    }
    public static void main(String[] args) {
        takesD(new Z());
        takesE(new Z().makeE());
        /**
         * Output:
         * D strD
         * Z strE
         */
    }
}
